package com.orange.wwwapi.controller.category;

import com.orange.core.pojo.R;
import com.orange.core.pojo.entity.category.ProductCategory;
import com.orange.core.service.category.ProductCategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品分类
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/productCategory")
public class ProductCategoryController {

    private final ProductCategoryService productCategoryService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public R<List<ProductCategory>> list() {
        return R.ok(productCategoryService.list());
    }
}
